﻿<%@ Page Title="Домашняя страница" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="users2.aspx.cs" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <h2>
            Добро пожаловать в Users:
    </h2>
    
       
   
   <asp:DetailsView ID="ManageProducts" runat="server" AllowPaging="True"
    AutoGenerateRows="False" DataKeyNames="id_user"
    DataSourceID="ManageProductsDataSource" EnableViewState="False" 
        onpageindexchanging="ManageProducts_PageIndexChanging">
    <Fields>
        <asp:BoundField DataField="id_user" HeaderText="id_user" ReadOnly="True" 
            SortExpression="id_user" />
        <asp:BoundField DataField="Nickname" HeaderText="Nickname"
            SortExpression="Nickname" />
        <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
        <asp:BoundField DataField="lastname" HeaderText="lastname"
            SortExpression="lastname" />
        <asp:BoundField DataField="middlename" HeaderText="middlename" 
            SortExpression="middlename" />
        <asp:BoundField DataField="id_status" HeaderText="id_status" 
            SortExpression="id_status" />
    </Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="ManageProductsDataSource" runat="server"
    ConnectionString="<%$ ConnectionStrings:SevTwitterConnectionString %>"
    DeleteCommand=
        "DELETE FROM [users] WHERE [id_user] = @original_id_user AND [Nickname] = @original_Nickname AND [Name] = @original_Name AND (([lastname] = @original_lastname) OR ([lastname] IS NULL AND @original_lastname IS NULL)) AND (([middlename] = @original_middlename) OR ([middlename] IS NULL AND @original_middlename IS NULL)) AND [id_status] = @original_id_status"
    InsertCommand=
        "INSERT INTO [users] ([id_user], [Nickname], [Name], [lastname], [middlename], [id_status]) VALUES (@id_user, @Nickname, @Name, @lastname, @middlename, @id_status)"
    SelectCommand=
        "SELECT * FROM [users]"
    
        UpdateCommand=
        "UPDATE [users] SET [Nickname] = @Nickname, [Name] = @Name, [lastname] = @lastname, [middlename] = @middlename, [id_status] = @id_status WHERE [id_user] = @original_id_user AND [Nickname] = @original_Nickname AND [Name] = @original_Name AND (([lastname] = @original_lastname) OR ([lastname] IS NULL AND @original_lastname IS NULL)) AND (([middlename] = @original_middlename) OR ([middlename] IS NULL AND @original_middlename IS NULL)) AND [id_status] = @original_id_status" 
        ConflictDetection="CompareAllValues" 
        OldValuesParameterFormatString="original_{0}">
    <DeleteParameters>
        <asp:Parameter Name="original_id_user" Type="Int32" />
        <asp:Parameter Name="original_Nickname" Type="String" />
        <asp:Parameter Name="original_Name" Type="String" />
        <asp:Parameter Name="original_lastname" Type="String" />
        <asp:Parameter Name="original_middlename" Type="String" />
        <asp:Parameter Name="original_id_status" Type="Int32" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="Nickname" Type="String" />
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="lastname" Type="String" />
        <asp:Parameter Name="middlename" Type="String" />
        <asp:Parameter Name="id_status" Type="Int32" />
        <asp:Parameter Name="original_id_user" Type="Int32" />
        <asp:Parameter Name="original_Nickname" Type="String" />
        <asp:Parameter Name="original_Name" Type="String" />
        <asp:Parameter Name="original_lastname" Type="String" />
        <asp:Parameter Name="original_middlename" Type="String" />
        <asp:Parameter Name="original_id_status" Type="Int32" />
    </UpdateParameters>
    <InsertParameters>
        <asp:Parameter Name="id_user" Type="Int32" />
        <asp:Parameter Name="Nickname" Type="String" />
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="lastname" Type="String" />
        <asp:Parameter Name="middlename" Type="String" />
        <asp:Parameter Name="id_status" Type="Int32" />
    </InsertParameters>
</asp:SqlDataSource>


    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="id_user" 
                DataSourceID="SqlDataSource1">
                <Columns>
                    <asp:BoundField DataField="id_user" HeaderText="id_user" ReadOnly="True" 
                        SortExpression="id_user" />
                    <asp:BoundField DataField="Nickname" HeaderText="Nickname" 
                        SortExpression="Nickname" />
                    <asp:BoundField DataField="Name" HeaderText="Name" 
                        SortExpression="Name" />
                    <asp:BoundField DataField="lastname" HeaderText="lastname" 
                        SortExpression="lastname" />
                    <asp:BoundField DataField="middlename" HeaderText="middlename" 
                        SortExpression="middlename" />
                    <asp:BoundField DataField="id_status" HeaderText="id_status" 
                        SortExpression="id_status" />
                </Columns>
            </asp:GridView>
            
            
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
              ConnectionString="<%$ ConnectionStrings:SevTwitterConnectionString %>" 
              SelectCommand="SELECT * FROM [users]" 
        UpdateCommand="UPDATE users SET id_user =, Nickname =, Name =, lastname =, middlename =, id_status = FROM users INNER JOIN status ON users.id_status = status.id_status INNER JOIN passwords ON users.id_user = passwords.id_user"></asp:SqlDataSource>
          
     
      <div class="footer">
        
        
    </div>
</asp:Content>
